﻿<UserControl x:Class="CI.MSRoboticsEnv.MudMap"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:MSRoboticsEnv="clr-namespace:CI.MSRoboticsEnv" mc:Ignorable="d"              >
    <GroupBox Header="Mud Map" ClipToBounds="True">
        <ItemsControl ItemsSource="{Binding Path=OrganismModels}" ClipToBounds="True" >
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas MinHeight="250" MinWidth="250"  />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemContainerStyle>
                <Style>
                    <Setter Property="Canvas.Top" Value="{Binding YLocation}"/>
                    <Setter Property="Canvas.Left" Value="{Binding XLocation}"/>
                </Style>
            </ItemsControl.ItemContainerStyle>
            <ItemsControl.ItemTemplate>
                <DataTemplate DataType="{x:Type MSRoboticsEnv:OrganismDrawModel}">
                    <Rectangle StrokeThickness="{Binding StrokeThickness}" Stroke="{Binding BrushColour}" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </GroupBox>
</UserControl>
